function hex2bin(hex) {
	let bin = ''
	let list = hex.split(/[(\r\n)\r\n]+/)
	let count = list.length
	let baseAddress = ''
	let nextAddress = 0
	for(let i = 0; i < count; i++) {
		switch(list[i].substring(7, 9)) {
			case '04':
				baseAddress = list[i].substring(9, 13)
			break
			case '00':
				let length = list[i].length
				let data = list[i].substring(9, length -2)
				let address = parseInt(baseAddress + list[i].substring(3, 7), 16)
				nextAddress = address + (data.length / 4)
				if (nextAddress != 0) {
					if (address > nextAddress) {
						let num = (address - nextAddress) * 2
						for (let j = 0; j < num; j++) {
							bin += 'FF'
						}
					}
				}
				bin += data
			break
			case '01':
				console.log("读取结束", i)
			break
		}
	}
	var array = new Uint8Array(bin.match(/[\da-f]{2}/gi).map(function(h) {
		return parseInt(h, 16)
	}))
	return array
}
export {
	hex2bin,
};